<?php

/**
 * This is the model class for table "objekwisata".
 *
 * The followings are the available columns in table 'objekwisata':
 * @property integer $ow_id
 * @property integer $ow_bulan
 * @property integer $ow_objek
 * @property integer $ow_jmlpengunjung
 * @property integer $ow_penjualankarcis
 * @property integer $ow_tahun
 */
class Objekwisata extends CActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @return Objekwisata the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'objekwisata';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('ow_bulan, ow_objek, ow_jmlpengunjung, ow_penjualankarcis, ow_tahun', 'numerical', 'integerOnly'=>true),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('ow_id, ow_bulan, ow_objek, ow_jmlpengunjung, ow_penjualankarcis, ow_tahun', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'ow_id' => 'Ow',
			'ow_bulan' => 'Ow Bulan',
			'ow_objek' => 'Ow Objek',
			'ow_jmlpengunjung' => 'Ow Jmlpengunjung',
			'ow_penjualankarcis' => 'Ow Penjualankarcis',
			'ow_tahun' => 'Ow Tahun',
		);
	}

	/**
	 * Retrieves a list of models based on the current search/filter conditions.
	 * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
	 */
	public function search()
	{
		// Warning: Please modify the following code to remove attributes that
		// should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('ow_id',$this->ow_id);
		$criteria->compare('ow_bulan',$this->ow_bulan);
		$criteria->compare('ow_objek',$this->ow_objek);
		$criteria->compare('ow_jmlpengunjung',$this->ow_jmlpengunjung);
		$criteria->compare('ow_penjualankarcis',$this->ow_penjualankarcis);
		$criteria->compare('ow_tahun',$this->ow_tahun);

		return new CActiveDataProvider($this, array(
			'criteria'=>$criteria,
		));
	}
}